
function init_search()
{
	_select_layer = document.getElementById('select_layer');
	var map = null;
	for (var i = 0; i < map_WFS.length; i++) {
		map = map_WFS[i];
		var elOptNew = document.createElement('option');
		elOptNew.text = map.Layer_Name;
		elOptNew.value = map.IndexLayer;
		//alert(map.IndexLayer);
		try {
			// not IE
			_select_layer.add(elOptNew, null);
		} catch (ex) {
			// IE only
			_select_layer.add(elOptNew);
		}
	}
}
function showSearching(_url) { 

		AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {

     dialog = new A.Dialog({
            					title: "Searching",
            					centered: true,
            					draggable: true,
            					modal: true,
            					height: 600,
            					width: 800,
            					scrollbars: true,
            					bodyContent: '<button type="button" onclick="dialogId.close()" value="close"></button>'
        					}).plug(A.Plugin.IO, {uri:_url}).render();
    
     dialog.show();
 	 });
} 
function selectSearchLayer()
{
	 var e = document.getElementById("select_layer");
	 var indexLayer = e.options[e.selectedIndex].value;
	 	 str = Vector_Array[indexLayer - numBaseLayer].LayerId;
	 	 ID_LAYER = indexLayer;
	 	 layer_length = map.layers[ID_LAYER].features.length;
}